package m3d31;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;

/*
编码   解码
* */
//转换流Outputstreamwriter  继承writer  字符流通向字节流的桥梁
public class lOutputstreamwriter {
    public static void main(String[] args) throws IOException {
        //编码表名称不分大小写  不写默认utf-8
        OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("day02\\src\\m3d31\\m.txt"),
                "gbk");

        //写入缓冲区
        osw.write("嗨嗨");

        osw.flush();
        osw.close();
    }
}
